POV-Ray : Newsgroups : povray.binaries.images : Zeger's greebles.inc : Re: Zeger's greebles.inc Server Time
5 Nov 2024 20:16:53 EST (-0500)
  Re: Zeger's greebles.inc  
From: Zeger Knaepen
Date: 8 Jun 2006 08:17:36
Message: <44881560$1@news.povray.org>
"Doctor John" <doc### [at] linuxmailorg> wrote in message 
news:4487ee1d@news.povray.org...
> Whilst attempting to debug Zeger's greebles.inc I managed to produce 
the 
> attached - definitely "under construction". Also attached both pov and 

> megapov output for unmodified Zeger code
> Now for the bit that is likely to provoke a few flames
> #declare FLAMEPROOF_UNDERWEAR=true;
> First thing to be spotted
> #macro RoundPrism(Points,R,H)
>     #local Aantal=dimension_size(Points,1);
>     #local Tel=0;
>     #local Aantal2=Aantal;
>     #local Points2=array[Aantal];
> -- CUT --
>  BLAH
> -- CUT --
>          #if (Aantal2>2)
>             polygon {
>                 Aantal2,
>                 #local Tel=0;
>                 #while (Tel<Aantal)
>                     #ifdef(Points2[Tel])
>                         <Points2[Tel].x,Points2[Tel].y>
>                     #end
>                     #local Tel=Tel+1;
>                 #end
>                 translate -z*H
>             }
>         #end
>     rotate x*90
>     }
> #end
> Surely there's a fencepost error here. If I wish to produce an n-sided 

> polygon, I need n+1 (Antaal+1) points.
> Possibly -
> polygon {
>        Aantal2,
>               #local Tel=0;
>                 #while (Tel<Aantal+1) //Umm....why are we using Antaal 

> instead of Antaal2??
>                     #ifdef(Points2[Tel])
>                         <Points2[Tel].x,Points2[Tel].y>,
>                     #end
>                     #local Tel=Tel+1;
>                 <Points2[0].x,Points2[0].y>
>                 #end
>                 translate -z*H
>             }
>                 -would work and prevent the "polygon not closed" 
warnings

I tend to ignore warnings, but yes, indeed, that would be better :)

but that's not the problem though, POV-Ray just closes the prism for you 
if you forget to

> Secondly (and to my eyes this a BIG problem) why is the macro 
> VerdeelSuperellipsoid calling itself?
> #macro 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,BevelHeight,StepF,
StepB,Diepte)
>  #if (Diepte<0)
>   #local Scale=BevelHeight*(.5+rand(Seed)*.5);
>   
SuperEllipsoidSegment(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,StepF,StepB)

>   #ifndef (Detail) #local Detail=5; #end
>   
SuperEllipsoidGreeble(Rx,Ry,Rz,n1,n2,F1,F2,B1,B2,Bevel,Scale,Detail,StepF
,StepB)
>  #else
>   #local PercentageU=.5+(rand(Seed)-rand(Seed))*.5*.6;
>   #local PercentageV=.5+(rand(Seed)-rand(Seed))*.5*.6;
>   #local FM=F1+(F2-F1)*PercentageU;
>   #local BM=B1+(B2-B1)*PercentageV;
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,B1,BM,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,B1,BM,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,F1,FM,BM,B2,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
> XXXX 
> 
VerdeelSuperellipsoid(Rx,Ry,Rz,n1,n2,FM,F2,BM,B2,Bevel,BevelHeight,StepF,
StepB,Verlaag(Diepte))
>  #end
> #end
> Enlightenment needed.

because it's a recursive macro, that's the whole idea :)

but, as far as I know, there are no problems with the 
superellipsoidal-greebles.

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.